
import React, { Component } from 'react';
// 引入图片
import logo from '../../assets/images/logo192.png'
class Index extends Component {
	// 发布函数
	handlePublish() {
		const { closeMess, submit } = this.props
		// 关闭
		closeMess && closeMess()
		// 提交
		submit && submit(this.textarea.value)

	}
	render() {
		const { visible } = this.props
		return (
			<div className="mess" style={{ display: visible ? 'block' : 'none' }}>
				<div className="context">
					<h3>评论</h3>
					<div className="content">
						<img src={logo} alt="" width={50} />
						<textarea name="" id="" cols="30" rows="10" ref={ (ref) => { this.textarea = ref } }></textarea>
					</div>
					<p>
						<button onClick={() => this.handlePublish()}>发布</button>
					</p>
				</div>
			</div>
		);
	}
}

export default Index;
